package com.fzrskj.cloud.free.core.enums.diy;

/**
 * DiyProductStatusEnum.
 *
 * @author zj.
 *         Created on 2019/1/15 0015.
 */
public enum DiyProductStatusEnum {
    /**
     * 待审核开通
     */
    WAIT(99, "待审核"),
    /**
     * 正常
     */
    NORMAL(1, "正常"),
    /**
     * 暂停.
     */
    STOP(2, "停止"),
    /**
     * 过期停止.
     */
    EXPIRE(3, "过期");
    /**
     * 状态.
     */
    private Integer status;

    /**
     * 名称.
     */
    private String name;

    /**
     * construct.
     * @param status status.
     * @param name name.
     */
    DiyProductStatusEnum(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    /**
     * 获取状态.
     * @return Integer.
     */
    public Integer getStatus() {
        return this.status;
    }

    /**
     * 获取名称.
     * @return String.
     */
    public String getName() {
        return this.name;
    }

    /**
     * equals.
     * @param comparisonStatus comparison value.
     * @return Boolean.
     */
    public Boolean equals(Integer comparisonStatus) {
        return this.status.equals(comparisonStatus);
    }

    /**
     * get name by status.
     * @param status status.
     * @return String of name.
     */
    public static String getName(Integer status) {
        String name = "";
        for (DiyProductStatusEnum statusEnum : DiyProductStatusEnum.values()) {
            if (statusEnum.equals(status)) {
                name = statusEnum.getName();
                break;
            }
        }
        return name;
    }
}
